package com.tnsw.noxnox.downloader;

import android.util.Log;

public class YoutubeAttr extends AttrBase {
	private String tag = "YoutubeAttr";
	private String quality;
	
	public void setQuality(String q) {
		this.quality = q;
	}
	
	public String getQuality() {
		return(this.quality);
	}
	
	@Override
	public String toString() {
		String s = super.toString();
		s = s + ", quality=" + this.getQuality();
		
		return(s);
	}
	
	public String getExtension() {
		if (this.getContentType() != null) {
			if (this.getContentType().equals("") ==  false) {
				try {
					String ext = this.getContentType().split(";")[0].split("/")[1];
					Log.d(tag, "YoutubeAttr - returing extension=" + ext);
					return(ext);	
				} catch (Exception e) {
					Log.e(tag, "Cannot find extension from contentType=" + this.getContentType());
				}
				
			}
		}
		
		return("");
	}
}
